var btns = document.querySelectorAll('.product ul>li')
var tabs = document.querySelectorAll('.product ol>li')

for (var i = 0; i < btns.length; i++) {
    btns[i].onclick = function (index) {
        for (var i = 0; i < tabs.length; i++) {
            btns[i].className = ''
            tabs[i].className = ''
        }
        this.className = 'active'
        tabs[index].className = 'active'
    }.bind(btns[i], i) //使用bind 传递参数

}